package cn.chengpengper.seckill.reservation.application.builder;

import cn.chengpengper.seckill.common.builder.SeckillCommonBuilder;
import cn.chengpengper.seckill.common.utils.bean.BeanUtil;
import cn.chengpengper.seckill.reservation.application.command.SeckillReservationConfigCommand;
import cn.chengpengper.seckill.reservation.domain.model.entity.SeckillReservationConfig;

/**
 * @author chengpeng.hu
 */
public class SeckillReservationConfigBuilder extends SeckillCommonBuilder {

    public static SeckillReservationConfig toSeckillReservationConfig(SeckillReservationConfigCommand seckillReservationConfigCommand){
        if (seckillReservationConfigCommand == null || seckillReservationConfigCommand.isEmpty()){
            return null;
        }
        SeckillReservationConfig seckillReservationConfig = new SeckillReservationConfig();
        BeanUtil.copyProperties(seckillReservationConfigCommand, seckillReservationConfig);
        return seckillReservationConfig;
    }
}
